clear all;

ca = 0.299;
cb = 0.114;
cc = 0.564;
cd = 0.713;


row1 = [1  1/cd 0];
row2 = [1 -ca/(cd*(1-ca-cb)) -cb/(cc*(1-ca-cb))];
row3 = [1 0 1/cc];

fprintf('red %f %f %f\n', row1);
fprintf('grn %f %f %f\n', row2);
fprintf('blu %f %f %f\n', row3);

fprintf('ov6620 data sheet\n');

a = [ 0.31   0.59  0.11, 
    (0.713 - 0.731*.31) (-0.731*0.59)  (-0.731*0.11),
    (-0.564*0.31) (-0.564*0.59) (0.564-0.564*0.11)];
aiverse = inv(a)

